module InputActive

open System

let getchar () =
  let c = Console.Read ()
  if c = -1 then None else Some (char c)

let input =
  Seq.unfold (fun st -> getchar () |> Option.map (fun c -> (c, st))) ()

let getline () =
  let line = Console.ReadLine ()
  if line = null then None else Some line

let lines =
  Seq.unfold (fun st -> getline () |> Option.map (fun line -> (line, st))) ()

let (| Int | _ |) s =
  match Int32.TryParse(s) with
  | (true, n) -> Some n
  | _ -> None

let parse (line: string) =
  match line.Split([| '\t'; ':' |]) with
  | [| name; Int kor; Int math; Int eng |] ->
    (name.Trim(), kor, math, eng)
  | _ -> failwith (sprintf "parsing error [%s]" line)

let main =
  lines
  |> Seq.map parse
  |> Seq.iter (printf "%A\n")
